<?php
	$title_h3 = $action == 'edit' ? '修改' : '添加子';
	$form_action = $action == 'edit' ? 'regionUpdate' : 'regionInsert';
?>
<link rel="stylesheet" href="/public/assets/sysadmin/mylzp/css/plugins/tagsinput/jquery.tagsinput.css">
<link rel="stylesheet" href="/public/assets/sysadmin/mylzp/css/plugins/datetimepicker/datetimepicker.css">
<div id="pub_edit_bootbox" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 id="myModalLabel"><?=$title_h3?>菜单</h4>
        <div class="modal-body">
			<form id="pub_form" class="form-horizontal" method="POST" action="<?=$this->url('system/'.$form_action)?>">
				<input type="hidden" class="input-xlarge" id="id" name="id" value="<?=$data['id']?>">	
				<div class="control-group">
					<label class="control-label">菜单名称</label>
					<div class="controls">
						<input type="text" class="input-xlarge" id="title" name="title" value="<?=isset($data['info']['title'])?$data['info']['title']:''?>">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">模块</label>
					<div class="controls">
						<input type="text" class="input-xlarge" id="module" name="module" value="<?=isset($data['info']['module'])?$data['info']['module']:''?>">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">方法</label>
					<div class="controls">
						<input type="text" class="input-xlarge" id="method" name="method" value="<?=isset($data['info']['title'])?$data['info']['method']:''?>">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">参数</label>
					<div class="controls">
						<input type="text" class="input-xlarge" id="parameter" name="parameter" value="<?=isset($data['info']['title'])?$data['info']['parameter']:''?>">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">是否显示</label>
					<div class="controls">
						<select data-rule-required="true" id="isshow" name="isshow">
							<option value="1" <?=isset($data['info']['isshow'])&&$data['info']['isshow']==1?'selected':''?>>显示</option>
							<option value="0" <?=isset($data['info']['isshow'])&&$data['info']['isshow']==0?'selected':''?>>不显示</option>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">状态</label>
					<div class="controls">
						<select data-rule-required="true" id="state" name="state">
							<option value="1" <?=isset($data['info']['state'])&&$data['info']['state']==1?'selected':''?>>启用</option>
							<option value="0" <?=isset($data['info']['state'])&&$data['info']['state']==0?'selected':''?>>禁用</option>
						</select>
					</div>
				</div>
				<div class="form-actions">
					<input type="submit" value="确定" class="btn btn-primary show_shadefrist">
					<button class="btn" type="button" data-dismiss="modal">取消</button>
				</div>
			</form>
		</div>
    </div>
    <script type="text/javascript">
    $('#pub_form').ajaxForm({
    	success:function(r){
    		if(r.state == 1){
    			pub_alert_success(r.info);
    			setTimeout('location.reload()',1000);
    		}else{
    			pub_alert_error(r.info);
    		}
    	}, 
    	dataType: 'json'
    });
    </script>
</div>
